package com.vector.demo.mapper;

import com.vector.demo.pojo.Assignment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AssignmentMapper {

    //增加作业
    int addAssignment(Assignment assignment);

    //根据id删除作业
    Assignment dropAssignmentById(int ass_id);

    //根据教师删除作业
    Assignment dropAssignmentByTeacher(String ass_teacher);

    //根据班级删除作业
    Assignment dropAssignmentByClass(String ass_class);

    //根据学生删除作业
    Assignment dropAssignmentByStudent(String ass_student);

    //修改学生作业内容
    int modifyAssignmentContent(Assignment assignment);

    //修改学生作业成绩
    int modifyAssignmentGrade(Assignment assignment);

    //根据班级和状态为0时查询作业
    List<Assignment> selectAssignment(String ass_class);
    //根据班级和状态为1时查询作业
    List<Assignment> selectAssignment1(String ass_class);
    //根据教师名和班级查询作业列表
    List<Assignment> selectAssignment2(@Param("ass_teacher") String ass_teacher,@Param("ass_class") String ass_class);
    //修改成绩
    int updateGrade (@Param("ass_grade") String ass_grade,@Param("ass_status")int ass_status, @Param("ass_id") int ass_id);
    //id查询成绩
    Assignment selectAssignmentById(int ass_id);
}
